# -*- coding: utf-8 -*-
"""
Created on Wed Nov 14 23:34:34 2018

@author: Administrator
"""

class SeqQueue:
    
    def __init__(self):
        self.elements = []
        self.length = 0
        
    def is_empty(self):
        if self.length == 0:
            return True
        return False
    
    def enqueue(self, element):
        """入队
        """
        self.elements.append(element)
        self.length += 1
        
    def dequeue(self):
        """出队
        """
        if self.is_empty():
            raise ValueError("queue is empty!")
        result = self.elements.pop(0)
        self.length -= 1
        return result
    
    def peek(self):
        if self.is_empty():
            raise ValueError("queue is empty!")
        return self.elements[0]
        
    def print_all(self):
        return self.elements